/*
The MIT License (MIT)

Copyright (c) 2013 Bert Wierenga

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software 
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#pragma once

#include "hhdMatrix4.h"
#include "hhdVector4.h"
#include "hhdVector2.h"
#include "hhdColor.h"
#include "hhdTypes.h"

namespace hhd
{
	typedef enum
	{
		SBF_NONE			= 0x00,

		SBF_VERTEX_SHADER	= 0x01,
		SBF_PIXEL_SHADER	= 0x02,

		SBF_COMPUTE_SHADER	= 0x04
	} GfxShaderBindFlags;

	typedef enum
	{
		P_FLOAT,
		P_FLOAT2,
		P_FLOAT3,
		P_FLOAT4,

		P_FLOAT4X4,

		P_UINT,
		P_INT,

		P_COLOR
	} GfxPrimitive;

	struct GfxWVP
	{
		Matrix4 _world;
		Matrix4 _view;
		Matrix4 _projection;
		Matrix4 _wvp;
		Vector4 _camera_position_ws;
	};

	struct GuiTransform2D
	{
		Vector2 _position;
		Vector2 _extents;
		float _rotation;

		float _buffer1;
		Vector2 _buffer2;
	};

	//@baw	Use this for requirements for draws that are frequently consistent between objects.
	typedef int32_t GfxHandle;
	const int32_t invalid_gfx_handle = -1;

	typedef enum
	{		
		T2DF_R8G8B8A8_INT,
		T2DF_R8G8B8A8_UINT,
		T2DF_R8G8B8A8,

		T2DF_R16G16B16A16_INT,
		T2DF_R16G16B16A16_UINT,
		T2DF_R16G16B16A16,

		T2DF_R16,
		T2DF_R24,
		T2DF_R24G8,
		T2DF_R32,
		T2DF_R32G8,

		T2DF_D16,
		T2DF_D24,
		T2DF_D24S8,
		T2DF_D32,
		T2DF_D32S8,
	} GfxTexture2DFormat;	

	GfxTexture2DFormat GfxTexture2DFormatFromString(const String& in_string);

	struct GfxTexture2dConfig
	{
		uint32_t width;
		uint32_t height;
		uint32_t mip_count;
		GfxTexture2DFormat format;
	};
}